package com.lsfb.light.Light;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lsfb.light.R;
import com.lsfb.light.Utils.ProgressDialogManager;
import com.zgscwjm.lsfbbasetemplate.LsfbFragment;
import com.zgscwjm.lsfbbasetemplate.annotation.OnClick;
import com.zgscwjm.lsfbbasetemplate.annotation.ViewInject;
import com.zgscwjm.lsfbbasetemplate.annotation.ViewInjectUtils;

/**
 * Created by Administrator on 2018/4/23 0023.
 */

public class LightFragment extends LsfbFragment {

    private ProgressDialogManager dialogManager;
    private View view;

    @ViewInject(R.id.tv_light_food)
    private TextView tv_food;

    @ViewInject(R.id.tv_light_sport)
    private TextView tv_sport;

    @ViewInject(R.id.tv_light_car)
    private TextView tv_car;

    @ViewInject(R.id.tv_light_politics)
    private TextView tv_politics;

    @ViewInject(R.id.tv_light_finance)
    private TextView tv_finance;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fg_light, null);
        ViewInjectUtils.inject(this, view);
        dialogManager = new ProgressDialogManager(getActivity());
        return view;
    }

    @Override
    protected void Resume() {

    }

    @Override
    public void initData() {

    }

    @OnClick({R.id.tv_light_food, R.id.tv_light_sport, R.id.tv_light_car, R.id.tv_light_politics, R.id.tv_light_finance})
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_light_food:        //美食
                tv_food.setBackground(getResources().getDrawable(R.drawable.bg_btn_login));
                tv_sport.setBackground(null);
                tv_car.setBackground(null);
                tv_politics.setBackground(null);
                tv_finance.setBackground(null);
                break;
            case R.id.tv_light_sport:       //体育
                tv_food.setBackground(null);
                tv_sport.setBackground(getResources().getDrawable(R.drawable.bg_btn_login));
                tv_car.setBackground(null);
                tv_politics.setBackground(null);
                tv_finance.setBackground(null);
                break;
            case R.id.tv_light_car:         //车视界
                tv_food.setBackground(null);
                tv_sport.setBackground(null);
                tv_car.setBackground(getResources().getDrawable(R.drawable.bg_btn_login));
                tv_politics.setBackground(null);
                tv_finance.setBackground(null);
                break;
            case R.id.tv_light_politics:    //政治
                tv_food.setBackground(null);
                tv_sport.setBackground(null);
                tv_car.setBackground(null);
                tv_politics.setBackground(getResources().getDrawable(R.drawable.bg_btn_login));
                tv_finance.setBackground(null);
                break;
            case R.id.tv_light_finance:     //金融
                tv_food.setBackground(null);
                tv_sport.setBackground(null);
                tv_car.setBackground(null);
                tv_politics.setBackground(null);
                tv_finance.setBackground(getResources().getDrawable(R.drawable.bg_btn_login));
                break;
        }
    }
}
